<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/23
 * Time: 14:25
 */
namespace app\home\controller;

use think\Controller;
use think\captcha\Captcha;  //验证码用
use think\Session;

class Login extends Controller {
    /**
     * 登录页面
     */
    public function login()
    {
        $user_info = Session::get('S_USER_INFO');
        if($user_info){
            header('Location:http://'.$_SERVER['HTTP_HOST']);
            exit;
        }
        // 获取用户的授权
        $redirect_url = 'http://'.$_SERVER['HTTP_HOST'].'/home/Login/login';   // 授权回调地址
        $ifAuth = model('Base')->getAuthUserOpenid($redirect_url);
        return view();
    }

    /**
     * 验证登录
     */
    public function checkLogin()
    {
        $result = model('Login')->checkLoginM();
        return $result;
    }

    /**
     * 退出登录
     */
    public function loginOut()
    {
        $result = model('Login')->loginOutM();
        return $result;
    }

    /**
     * 微信授权
     */

    
}